package com.gxa.community.agent.controller;

import com.gxa.community.agent.service.agentindexservice.AgentIndexService;
import com.gxa.community.agent.utils.UrlUtils;
import com.gxa.community.core.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/agent/index")
public class IndexController {

    @Autowired
    private AgentIndexService agentIndexService;
    @GetMapping("/createurl")
    public R shareUrl(Integer userId){
        R r = agentIndexService.createUrl(userId);
        return r;
    }

    @GetMapping("/getall")
    public R getAllInfo(Integer userId){
        R r = agentIndexService.getAgentIndexInfo(userId);
        return r;
    }

    @GetMapping("/share")
    public R todayShare(){
        R r = agentIndexService.Todayshare();
        return r;
    }

    @GetMapping("/seckillgoods")
    public R todaySeckill(){
        R r = agentIndexService.todaySeckill();
        return r;
    }

    @GetMapping("/grouplgoods")
    public R todayGroup(){
        R r = agentIndexService.todayGroup();
        return r;
    }

    @GetMapping("/classification")
    public R classification(){
        R r = agentIndexService.classification();
        return r;
    }

    @GetMapping("/search")
    public R search(String goodsname){
        R r = agentIndexService.serach(goodsname);
        return r;
    }

    @GetMapping("/goodinfo")
    public R singleGoodsInfo(String goodsname){
        R r = agentIndexService.serach(goodsname);
        return r;
    }


}
